<?php 


header("Content-type: text/html; charset=utf-8"); 

$mysqli = @new mysqli("127.0.0.1", "root", "", "stu");

if ($mysqli->connect_errno) {
	echo "数据库连接失败";
	echo "<br>";
	echo "错误代码：".$mysqli->connect_errno;
	echo "<br>";
	echo "错误信息：".$mysqli->connect_error;
}

$mysqli->query("set names utf8");

$sql = "select * from stu";

$sql = 'update1 stu set age="10" where id = "15"';

$sql = "select * from stu";

$res = $mysqli->query($sql);

if (!$res) {
	echo "操作失败";
	echo "<br>";
	echo "错误代码：".$mysqli->errno;
	echo "<br>";
	echo "错误信息：".$mysqli->error;
}

$arr = [];

while ($row = $res->fetch_assoc()) {
	$arr[]=$row;
}


var_dump($arr);



 ?>